package com.liqi.frame.comm.config;

import com.liqi.frame.comm.filter.ChannelFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 过滤器注册
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<ChannelFilter> channelFilter(){
        FilterRegistrationBean<ChannelFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(new ChannelFilter());
        bean.setName("channelFilter");
        bean.addUrlPatterns("/*");
        bean.setOrder(1);
        return bean;
    }
}